<template>
  <!-- 出租商列表  -->
  <div class="service-box ">
    <div class="content flex" v-if="chuzushangList&&chuzushangList.length">
      <div class="item" v-for="item in chuzushangList" :key="item.tenantId">
        <el-card class="box-card">
          <el-descriptions border :column="1">
            <el-descriptions-item label="号商名称">
              <div class="flex logo_box">
                <img :src="item.avatar" alt="LOGO">
                <div>{{item.tenantName}}</div>
              </div>
            </el-descriptions-item>
            <el-descriptions-item label="介绍">{{item.introduction}}</el-descriptions-item>

          </el-descriptions>
        </el-card>

      </div>
    </div>
    <div v-else style="text-align:center;line-height:300px">
      暂无数据
    </div>
  </div>
</template>

<script>
import phoneApi from "@/api/phoneManage";
import { mapGetters } from "vuex";
export default {
  name: "",
  props: ["tenantId", "campNumber"],
  components: {},
  data() {
    return {
      loading: false,
      // 查询参数
      queryParams: {},
      chuzushangList: [],
      tenantIdCur: "", //当前租户id
      campNumberCur: "", //当前租户虞豆
    };
  },
  // watch:{
  //   tenantId:{
  //     handler(newVal){
  //       this.tenantIdCur = newVal
  //       this.getthemeList()
  //     },
  //     immediate:true
  //   },
  //   campNumber:{
  //     handler(newVal){
  //       this.campNumberCur = newVal
  //     },
  //     immediate:true
  //   }
  // },
  created() {
    // let date = new Date()
    // this.nowDate = formatDate(date).slice(0,10)
    this.getthemeList();
  },
  computed: {
    ...mapGetters(["userInfo", "shopInfo"]),
    // dayNum(){
    //   return (val)=>{
    //     let date = (Date.parse(new Date(val)))/1000
    //     var today=(Date.parse(new Date()))/1000;//当前时间戳
    //     var nTime = date - today;
    //     var day =Math.floor(nTime/86400)+1;
    //     return day;
    //   }
    // }
  },
  methods: {
    // 获取所有的主题列表
    getthemeList() {
      this.loading = true;
      phoneApi
        .getIsLeaseTenantList({
          groupKey: "kaweichuzu",
        })
        .then((response) => {
          this.chuzushangList = response.data;
          this.loading = false;
        });
    },
  },
};
</script>
<style scoped lang="scss">
.content{
  .item{
    width: 45%;
    margin-right: 10px;
  }
}
.logo_box {
  div {
    font-weight: 601;
    font-size: 16px;
    line-height: 60px;
  }
  img {
    width:60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 10px;
  }
}
</style>
